package com.koko.mapper;

import com.github.pagehelper.Page;
import com.koko.annotation.AutoFill;
import com.koko.enumeration.OperationType;
import com.koko.game.dto.PublisherPageQueryDTO;
import com.koko.game.entity.Publisher;
import com.koko.news.dto.NewsPageQueryDTO;
import com.koko.news.entity.News;
import com.koko.news.vo.NewsVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;

@Mapper
public interface NewsMapper {

    /**
     * 分页查询
     * @param newsPageQueryDTO
     * @return
     */
    Page<News> pageQuery(NewsPageQueryDTO newsPageQueryDTO);

    /**
     * 插入新的新闻
     * @param news
     */
    @AutoFill(OperationType.INSERT)
    void insert(News news);

    /**
     * 根据id删除
     * @param id
     */
    void deleteById(Long id);

    /**
     * 更新数据
     * @param news
     */
    @AutoFill(OperationType.UPDATE)
    void update(News news);

    /**
     * 查询操作
     * @param id
     * @return
     */
    News getById(Long id);
}
